package org.xlh.springboot;

import com.xlh.springboot.bean.Vip;
import com.xlh.springboot.repository.VipMapper;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@MapperScan("com.xlh.springboot.repository")
@SpringBootApplication
public class Springboot313MybatisGeneratorApplication {

	public static void main(String[] args) {
		ConfigurableApplicationContext run = SpringApplication.run(Springboot313MybatisGeneratorApplication.class, args);

		VipMapper vipMapper = run.getBean(VipMapper.class);
		vipMapper.insert(new Vip("jack", "1001", "1990-01-01"));

		Vip vip = vipMapper.selectByPrimaryKey(1L);
		System.out.println(vip);

		run.close();
	}

}
